package com.hzdl.flower.util;

import lombok.NoArgsConstructor;
import lombok.ToString;


@ToString
@NoArgsConstructor

public class HZDLJsonResult {
    private Integer code;
    private String msg;
    private Long count;
    private Object data;

    public HZDLJsonResult(Integer code, String msg, Object data) {
        this.code = code;
        this.msg = msg;
        this.data = data;
    }

    public HZDLJsonResult(Integer code, String msg, Long count, Object data) {
        this.code = code;
        this.msg = msg;
        this.count = count;
        this.data = data;
    }

    public HZDLJsonResult(Integer code, String msg) {
        this.code = code;
        this.msg = msg;
    }

    public HZDLJsonResult(Integer code) {
        this.code = code;
    }

    public Integer getCode() {
        return code;
    }

    public void setCode(Integer code) {
        this.code = code;
    }

    public String getMsg() {
        return msg;
    }

    public void setMsg(String msg) {
        this.msg = msg;
    }

    public Object getData() {
        return data;
    }

    public void setData(Object data) {
        this.data = data;
    }

    public Long getCount() {
        return count;
    }

    public void setCount(Long count) {
        this.count = count;
    }

    // 添加成功
    public static final com.hzdl.flower.util.HZDLJsonResult ADD_SUCCESS = new com.hzdl.flower.util.HZDLJsonResult(SysConstast.CODE_SUCCESS,SysConstast.ADD_SUCCESS);
    //添加失败
    public static final com.hzdl.flower.util.HZDLJsonResult ADD_ERROR = new com.hzdl.flower.util.HZDLJsonResult(SysConstast.CODE_ERROR,SysConstast.ADD_ERROR);
    //更新成功
    public static final com.hzdl.flower.util.HZDLJsonResult UPDATE_SUCCESS = new com.hzdl.flower.util.HZDLJsonResult(SysConstast.CODE_SUCCESS,SysConstast.UPDATE_SUCCESS);
    //更新失败
    public static final com.hzdl.flower.util.HZDLJsonResult UPDATE_ERROR = new com.hzdl.flower.util.HZDLJsonResult(SysConstast.CODE_ERROR,SysConstast.UPDATE_ERROR);
    //删除成功
    public static final com.hzdl.flower.util.HZDLJsonResult DELETE_SUCCESS = new com.hzdl.flower.util.HZDLJsonResult(SysConstast.CODE_SUCCESS,SysConstast.DELETE_SUCCESS);
    //删除失败
    public static final com.hzdl.flower.util.HZDLJsonResult DELETE_ERROR = new com.hzdl.flower.util.HZDLJsonResult(SysConstast.CODE_ERROR,SysConstast.DELETE_ERROR);
    //重置成功
    public static final com.hzdl.flower.util.HZDLJsonResult RESET_SUCCESS = new com.hzdl.flower.util.HZDLJsonResult(SysConstast.CODE_SUCCESS,SysConstast.RESET_SUCCESS);
    //重置失败
    public static final com.hzdl.flower.util.HZDLJsonResult RESET_ERROR = new com.hzdl.flower.util.HZDLJsonResult(SysConstast.CODE_ERROR,SysConstast.RESET_ERROR);
    //分配成功
    public static final com.hzdl.flower.util.HZDLJsonResult DISPATCH_SUCCESS = new com.hzdl.flower.util.HZDLJsonResult(SysConstast.CODE_SUCCESS,SysConstast.DISPATCH_SUCCESS);
    //分配失败
    public static final com.hzdl.flower.util.HZDLJsonResult DISPATCH_ERROR = new com.hzdl.flower.util.HZDLJsonResult(SysConstast.CODE_ERROR,SysConstast.DISPATCH_ERROR);
    //状态码0 成功
    public static final com.hzdl.flower.util.HZDLJsonResult STATUS_TRUE = new com.hzdl.flower.util.HZDLJsonResult(SysConstast.CODE_SUCCESS);
    //状态码-1 失败
    public static final com.hzdl.flower.util.HZDLJsonResult STATUS_FALSE = new com.hzdl.flower.util.HZDLJsonResult(SysConstast.CODE_ERROR);
//    //批量删除成功
//    public static final com.hzdl.flower.util.HZDLJsonResult DELETE_SUCCESS1 = new com.hzdl.flower.util.HZDLJsonResult(SysConstast.CODE_SUCCESS,SysConstast.DELETE_SUCCESS1);
//    //批量删除失败
//    public static final com.hzdl.flower.util.HZDLJsonResult DELETE_ERROR2 = new com.hzdl.flower.util.HZDLJsonResult(SysConstast.CODE_ERROR,SysConstast.DELETE_ERROR2);


    public static com.hzdl.flower.util.HZDLJsonResult ok(Object obj){
        return new com.hzdl.flower.util.HZDLJsonResult(0,"OK",obj);
    }

    public static com.hzdl.flower.util.HZDLJsonResult error(Integer code , String msg){
        return new com.hzdl.flower.util.HZDLJsonResult(code,msg,null);
    }
}
